<%--
  Created by IntelliJ IDEA.
  User: 张思成
  Date: 2022/5/7
  Time: 19:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-3.6.0.js"></script>
    <script>
        $(function (){
            $("#btn").click(function (){
                $.post("jsonServlet",null,function (obj){
                    console.log(obj);
                    // for (var i=0;i<=obj.length-1;i++){
                    //     console.log(obj[i]);
                    // }
                    //解析装满对象的数组
                      $.each(obj,function (index,stu){
                          console.log(stu.sid+","+stu.sname)
                      });
                },"json");
            });
        });
    </script>
</head>
<body>
<input type="button" value="测试" id="btn">
</body>
</html>
